/*
 * 583.cxx
 *
 *  Created on: 9:39:19 PM Aug 22, 2012
 *      Author: xerxes
 *      I have not failed, I have just found 10000 ways that won't work.
 */

#include <iostream>
#include <algorithm>
#include <vector>
#include <sstream>
#include <fstream>
#include <string>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <functional>
#include <bitset>
#include <iomanip>

#include <ctime>
#include <cassert>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <climits>
#include <cstdlib>

using namespace std;

#define foR(i1,st,ed) for(int i1 = st , j1 = ed ; i1 < j1 ; ++i1 )
#define fo(i1,ed) foR( i1 , 0 , ed )
#define foE(i1,st,ed) foR( i1, st, ed+1 )
#define foit(i, x) for (typeof((x).begin()) i = (x).begin(); i != (x).end(); i++)
#define bip system("pause")
#define Int long long
#define pb push_back
#define SZ(X) (int)(X).size()
#define LN(X) (int)(X).length()
#define mk make_pair
#define SET( ARRAY , VALUE ) memset( ARRAY , VALUE , sizeof(ARRAY) )
#define line putchar('\n')

inline bool CI(int &_x) {
	return scanf("%d", &_x) == 1;
}
inline bool CI(int &_x, int &_y) {
	return CI(_x) && CI(_y);
}
inline bool CI(int &_x, int &_y, int &_z) {
	return CI(_x) && CI(_y) && CI(_z);
}
inline bool CI(int &_x, int &_y, int &_z, int &_zz) {
	return CI(_x) && CI(_y) && CI(_z) && CI(_zz);
}
inline void wait(double seconds) {
	double endtime = clock() + (seconds * CLOCKS_PER_SEC);
	while (clock() < endtime) {
		;
	}
}
int numbers[100];
int numberCount;
#define vlong long long
inline void proc(vlong num) {
	cout << num << " = ";
	numberCount = 0;
	if (num < 0) {
		num = -num;
		numbers[numberCount++] = -1;
	}
	for (vlong i = 2; i * i <= num; ++i) {
		if (num % i == 0) {
			while (num % i == 0) {
				numbers[numberCount++] = i;
				num /= i;
				//assert(numberCount<=100);
			}
		}
	}
	if (num != 1) {
		numbers[numberCount++] = num;
	}
	fo(i,numberCount) {
		if (i) {
			cout << " x ";
		}
		cout << numbers[i];
	}
	line;
}
int main() {
#ifndef ONLINE_JUDGE
	freopen("in", "r", stdin);
#endif
	int num;
	while ((scanf("%d", &num) == 1) && num != 0) {
		proc((vlong)num);
	}
	return 0;
}
